<?php
// =====================================================
// AnthroHeart Universe - The Cinematic Master (Final)
// - Real-Time Linux Kernel Telemetry
// - High-Integrity Unique IP Counter (SHA256)
// - Cinematic Cinematic Styling & SEO Suite
// =====================================================

// 1. CACHE BUSTING (Ensures real-time stats for all visitors)
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Pragma: no-cache");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

// 2. HIGH-INTEGRITY COUNTER LOGIC
$counter_file = __DIR__ . '/visitors.txt';
$unique_file  = __DIR__ . '/unique_visitors.txt';

if (!file_exists($counter_file)) { file_put_contents($counter_file, "1", LOCK_EX); }
if (!file_exists($unique_file)) { file_put_contents($unique_file, serialize([]), LOCK_EX); }

$count_raw = @file_get_contents($counter_file);
$count = is_string($count_raw) ? (int)trim($count_raw) : 1;

$ip = $_SERVER['REMOTE_ADDR'] ?? 'unknown';
$date = date('Y-m-d');
$visitor_key = hash('sha256', $ip . '|' . $date);

$unique_raw = @file_get_contents($unique_file);
$unique_visitors = @unserialize($unique_raw);
if (!is_array($unique_visitors)) { $unique_visitors = []; }

if (!in_array($visitor_key, $unique_visitors, true)) {
    $unique_visitors[] = $visitor_key;
    $count++;
    file_put_contents($counter_file, (string)$count, LOCK_EX);
    file_put_contents($unique_file, serialize($unique_visitors), LOCK_EX);
}

// 3. REAL-TIME SPEED (Reads from background node_monitor.sh)
function get_node_speed() {
    $file = 'https://www.anthroheart.com/speed.txt';
    if (file_exists($file)) {
        $data = trim(file_get_contents($file));
        return (!empty($data)) ? $data : "0.00";
    }
    return "0.00";
}
$live_speed = get_node_speed();

// 4. SEO CONFIGURATION
$site_url = "https://anthroheart.com";
$preview_img = $site_url . "/blueheart.png";
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>AnthroHeart Universe – A Public Domain Mythos</title>
  
  <!-- SEO & Social Previews (Telegram/Twitter/FB) -->
  <meta name="description" content="147 songs · 23 characters · 100% Public Domain. High-velocity Bitcoin notarized archive.">
  <meta property="og:title" content="AnthroHeart Universe – Public Domain Studio-in-a-Box">
  <meta property="og:description" content="Mythic. Musical. Free forever. Seeding at 1.5Gbps.">
  <meta property="og:image" content="<?= $preview_img ?>">
  <meta property="og:url" content="<?= $site_url ?>/">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:image" content="<?= $preview_img ?>">

  <link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@700&family=Montserrat:wght@400;600&family=Fira+Code&display=swap" rel="stylesheet">
  
  <style>
    :root {
      --gold: #d4af37;
      --soft-gold: #f4e5a1;
      --bg-dark: #0f0a05;
      --text-color: #ffebcd;
      --terminal-green: #00ff00;
    }

    body { margin:0; font-family:'Montserrat', sans-serif; background: var(--bg-dark); color: var(--text-color); line-height: 1.6; overflow-x: hidden; }
    .container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
    section { padding: 80px 0; border-bottom: 1px solid rgba(212,175,55,0.1); }
    h1, h2, h3 { font-family: 'Cinzel', serif; text-align: center; color: var(--gold); text-shadow: 0 0 15px rgba(212,175,55,0.4); }
    
    /* --- Hero / Marquee --- */
    .marquee-hero { position: relative; width: 100%; height: 80vh; min-height: 600px; background: #000; border-bottom: 5px solid var(--gold); overflow: hidden; }
    .marquee-frame { position: absolute; inset: 0; z-index: 3; pointer-events: none; border: 15px solid var(--gold); box-shadow: 0 0 40px rgba(255,215,0,0.6), inset 0 0 20px rgba(0,0,0,0.9); }
    .hero-text { position:absolute; top:50%; left:50%; transform:translate(-50%, -50%); text-align:center; z-index:5; width:90%; }

    /* --- Stats Grid (Real-Time Green) --- */
    .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin: 20px 0; }
    .stat-item { background: rgba(0, 255, 0, 0.05); border: 1px solid var(--terminal-green); padding: 15px; font-size: 0.9em; text-align: center; border-radius: 8px; }
    .live-pulse { color: var(--terminal-green); font-family: 'Fira Code', monospace; font-weight: bold; font-size: 1.4em; text-shadow: 0 0 8px var(--terminal-green); }

    /* --- Content Boxes --- */
    .golden-box { background: linear-gradient(180deg,#1a0f06,#2b1b0a); border: 2px solid var(--gold); border-radius: 18px; padding: 40px; box-shadow: 0 0 30px rgba(212,175,55,0.2); margin: 40px 0; }
    .terminal { background: #001a00; border: 2px solid var(--terminal-green); border-radius: 10px; padding: 25px; font-family: 'Fira Code', monospace; color: var(--terminal-green); box-shadow: 0 0 20px rgba(0,255,0,0.1); }
    
    /* --- Media --- */
    img { max-width: 100%; height: auto; border-radius: 12px; display: block; margin: 20px auto; }
    .video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 15px; border: 3px solid var(--gold); margin: 30px 0; }
    .video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

    /* --- Navigation --- */
    .node-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
    .node-card { flex:1; min-width:300px; background:rgba(212,175,55,0.05); border:2px solid var(--gold); padding:30px; text-align:center; text-decoration:none; color:inherit; border-radius:15px; transition: 0.3s; }
    .node-card:hover { transform: translateY(-5px); box-shadow: 0 0 30px var(--gold); }
    .btn-gold { display: inline-block; padding: 20px 50px; background: linear-gradient(45deg,#b8860b,#ffd700); color: #2b1b0a; font-size: 22px; font-weight: bold; text-decoration: none; border-radius: 50px; transition: 0.3s; box-shadow: 0 10px 30px rgba(255,215,0,0.4); }
    .btn-gold:hover { transform: scale(1.05); }

    .scroll-box { height: 300px; overflow-y: scroll; background: rgba(0,0,0,0.3); padding: 20px; border-radius: 10px; border: 1px solid #444; }
    footer { background: #000; padding: 80px 20px; text-align: center; border-top: 5px solid var(--gold); }
    .stats-badge { font-size: 3.5rem; color: var(--terminal-green); text-shadow: 0 0 15px var(--terminal-green); display: block; margin: 10px 0; font-family: 'Fira Code', monospace; }
  </style>
</head>
<body>

  <!-- HOLLYWOOD MARQUEE HERO -->
  <div class="marquee-hero">
    <div class="marquee-frame"></div>
    <iframe src="https://www.youtube.com/embed/l93bUo1imXE?autoplay=1&mute=1&loop=1&playlist=l93bUo1imXE&controls=0&modestbranding=1" style="width:100%; height:100%; border:none;" allow="autoplay; encrypted-media"></iframe>
    <div class="hero-text">
        <h1 style="font-size: clamp(2.5rem, 10vw, 5rem); margin:0;">AnthroHeart Universe</h1>
        <p style="font-size: 1.5rem; background:rgba(0,0,0,0.7); display:inline-block; padding:10px 40px; border-radius:50px; border:2px solid var(--gold);">A Public Domain Gift to Humanity</p>
    </div>
  </div>

  <div class="container">

    <!-- REAL-TIME TELEMETRY -->
    <section>
      <h2>🛰️ SATELLITE STATUS</h2>
      <p style="text-align:center;">Telemetry streamed from origin node ens6. Kernel statistics sampled in real-time.</p>
      <div class="stats-grid">
        <div class="stat-item">🚀 <strong>Seeding Velocity:</strong><br><span class="live-pulse"><?php echo $live_speed; ?> Mbps</span></div>
        <div class="stat-item">📉 <strong>Port Capacity:</strong><br><span class="live-pulse">1,500.00 Mbps</span></div>
        <div class="stat-item">🧠 <strong>Logic:</strong><br><span class="live-pulse">BBR-Optimized</span></div>
        <div class="stat-item">⛓️ <strong>Blockchain:</strong><br><span class="live-pulse">Block 929481</span></div>
      </div>
    </section>

    <!-- PURPOSE -->
    <section>
      <h2>The Genesis Mission</h2>
      <div class="golden-box">
        <p style="font-size:1.3rem; text-align:center;"><strong>AnthroHeart Universe is a complete “Studio-in-a-Box” creative franchise released fully into the Public Domain.</strong></p>
        <p>This includes 147 songs, 23 characters, and a massive trilogy of lore. Build your own movies, games, or art. Disney can use it, you can use it, the world owns it now.</p>
        <div style="background: rgba(212,175,55,0.1); padding:20px; border-radius:10px; margin-top:20px; font-style:italic; text-align:center;">
          "I have awakened from the Dream and now walk in the Completion Field."
        </div>
      </div>
    </section>

    <!-- ACCESS NODES -->
    <section>
      <h2>✦ THE ACCESS NODES ✦</h2>
      <div class="node-grid">
        <a href="<?= $site_url ?>/index.php" class="node-card">
          <div style="font-size:3rem;">📦</div>
          <h3>Genesis Bundle</h3>
          <p>Download the 5.33GB Full Archive (7z, Torrent, JSON Proofs)</p>
        </a>
        <a href="http://archive.anthroentertainment.com" target="_blank" class="node-card">
          <div style="font-size:3rem;">🏛️</div>
          <h3>Internet Archive</h3>
          <p>Permanent global mirror and browser-based file explorer.</p>
        </a>
      </div>
      <div style="text-align:center; margin-top:30px;">
        <a href="https://anthroentertainmentllc.itch.io/" target="_blank" class="btn-gold">Explore on itch.io</a>
      </div>
    </section>

    <!-- MEMORIES & TRADITIONAL ART -->
    <section>
      <h2>Memories in My Pencil</h2>
      <div style="text-align:center;">
        <img src="images/SherryDrawing.jpg" alt="Sherry Drawing" style="max-width:500px; border: 4px solid var(--gold);">
        <p style="margin-top:20px; font-style: italic; color: var(--gold);">Sherry: "Kiss my rose." — Graphite on paper.</p>
      </div>
      <p>Every story in this bundle started with real human connections. From Kelly Stricker and her quarter horses to the rubber-band wars in the Training department, these pencil lines remember every laugh. I built this 10GB universe to ensure that these frequencies belong to the world, not a corporation.</p>
    </section>

    <!-- THE GENESIS MACHINE -->
    <section>
      <h2>The Beast of '88</h2>
      <div style="text-align:center;">
        <img src="images/computer.jpg" alt="VTech PreComputer 1000" style="max-width:600px; border: 3px solid #4169e1;">
        <p style="color: #87cefa; margin-top:15px;">VTech PreComputer 1000. Where the logic began.</p>
      </div>
      <div class="terminal" style="margin-top:30px;">
        <p>> 10 PRINT "How many French fries did you eat?"<br>
        > 20 INPUT F<br>
        > 30 PRINT "How many inches was each French fry?"<br>
        > 40 INPUT I<br>
        > 50 PRINT "You just ate a "; F*I;" inch French fry."<br>
        > 60 END</p>
      </div>
      <p style="text-align:center; margin-top:20px; opacity: 0.8;">Peak comedy achieved at age 7. Digital sovereignty achieved today. 🍟</p>
    </section>

    <!-- PITCH DECK -->
    <section>
      <h2>The Vision: Pitch Deck</h2>
      <p style="text-align:center;">The 14-page document that defined 14 trillion dimensions of lore.</p>
      <div class="video-wrapper" style="padding-bottom: 120%;">
        <embed src="AnthroHeart_Deck.pdf" type="application/pdf" width="100%" height="100%" />
      </div>
    </section>

    <!-- CREDITS & INVESTMENT -->
    <section>
      <h2>Evolution & Investment</h2>
      <p style="text-align:center;">Total Invested in Artists and Developers: <strong>$21,815.01 USD</strong></p>
      <div class="scroll-box">
        <ul style="list-style: none; padding: 0;">
          <li style="margin-bottom:10px;">✦ Intention Repeater Multihasher Upgrades</li>
          <li style="margin-bottom:10px;">✦ Android App Update – Intention Repeater ($400)</li>
          <li style="margin-bottom:10px;">✦ Marketing & Publishing (Gregory Bair, MBA - $8,524)</li>
          <li style="margin-bottom:10px;">✦ Redo TheWarlockName.com (Nicolas H. - $1,323)</li>
          <li style="margin-bottom:10px;">✦ Fursuit Build (The Karelia Fursuits - $3,000)</li>
          <li style="margin-bottom:10px;">✦ Character Illustrations (Nicolas S., @orbnorsolya)</li>
          <li style="margin-bottom:10px;">✦ CUDA Optimization & WAV Mastering</li>
        </ul>
      </div>
    </section>

    <!-- FINANCIAL SOVEREIGNTY -->
    <section>
      <h2>🐾 Sovereignty over Debt</h2>
      <p>I built this on disability and said no to 126% interest loans. If you value this gift, help me establish the business checking account for Anthro Entertainment LLC.</p>
      <div style="text-align:center; padding: 40px; background: rgba(20,15,5,0.8); border: 2px solid var(--gold); border-radius: 20px;">
        <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=healing@intentionrepeater.com&currency_code=USD" class="btn-gold">Send Love via PayPal</a>
      </div>
    </section>

    <!-- METLIFE TRIBUTE -->
    <section>
        <div style="background: #fff; color: #333; padding: 30px; border-radius: 12px; border-left: 10px solid #0071c5;">
            <h2 style="color: #0071c5; text-align:left; text-shadow:none; margin-top:0;">Thank You, MetLife</h2>
            <p>"Get Met. It Pays." — It truly does. MetLife delivered on their promise during my most challenging chapter. I am grateful for their role in this launch.</p>
            <p style="text-align:right; font-style:italic; margin:0;">– Anthro Entertainment LLC</p>
        </div>
    </section>

  </div>

  <footer>
    <div class="container">
      <div class="terminal" style="display:inline-block; padding: 10px 40px; margin-bottom: 20px;">
        <span class="stats-badge"><?php echo number_format($count); ?></span>
        Unique Discovery Events
      </div>
      <p>© 2025 Thomas B Sweet · Public Domain · Anchored to Bitcoin Block 929481</p>
      <p style="opacity: 0.4; font-size: 0.8rem;">Node: 69.48.205.55 (Debian 12) | BBR Active</p>
    </div>
  </footer>

</body>
</html>